import React from 'react'
import { Button, Table } from 'antd'
import ContentStyle from './ContentStyle'
import store from './store'
import { useEffect,useState } from 'react'
import MoTaiKuan from './MoTaiKuan/MoTaiKuan'

import { Provider } from 'react-redux'



const rowSelection = {
  onChange: (selectedRowKeys, selectedRows) => {
    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
  }
};

export default function Content() {
  const [selectionType] = useState('checkbox');
  const columns = store.getState().tableList
  const data = store.getState().dataList
  //console.log(data);
console.log(data);

  return (
    <Provider store={store}>
      <ContentStyle>
        <p className="line_box"></p>
        <div>
          <MoTaiKuan></MoTaiKuan>
          <Button>删除</Button>
          <Button>导入</Button>
        </div>

        <div>

          <Table
           rowSelection={{
            type: selectionType,
            ...rowSelection,
            }}
          columns={columns} bordered
            dataSource={data}
            pagination={false}
            
           
          >

          </Table>
        </div>
      </ContentStyle>
    </Provider>

  )
}
